package application.models;

// Generated 8-dic-2011 3.00.32 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
 * Modwinewines generated by hbm2java
 */
@Entity
@Table(name = "modwinewines", catalog = "wineshop")
public class Modwinewines implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	private Long wineId;
	private Modwinetypes modwinetypes;
	private Modwinewineries modwinewineries;
	private String name;
	private String description;
	private int year;
	private float price;
	private Set<Modwineitems> modwineitemses = new HashSet<Modwineitems>(0);

	public Modwinewines() {
	}

	public Modwinewines(String name, int year, float price) {
		this.name = name;
		this.year = year;
		this.price = price;
	}

	public Modwinewines(Modwinetypes modwinetypes,
			Modwinewineries modwinewineries, String name, String description,
			int year, float price, Set<Modwineitems> modwineitemses) {
		this.modwinetypes = modwinetypes;
		this.modwinewineries = modwinewineries;
		this.name = name;
		this.description = description;
		this.year = year;
		this.price = price;
		this.modwineitemses = modwineitemses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "wine_id", unique = true, nullable = false)
	public Long getWineId() {
		return this.wineId;
	}

	public void setWineId(Long wineId) {
		this.wineId = wineId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "type_id")
	public Modwinetypes getModwinetypes() {
		return this.modwinetypes;
	}

	public void setModwinetypes(Modwinetypes modwinetypes) {
		this.modwinetypes = modwinetypes;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "winery_id")
	public Modwinewineries getModwinewineries() {
		return this.modwinewineries;
	}

	public void setModwinewineries(Modwinewineries modwinewineries) {
		this.modwinewineries = modwinewineries;
	}

	@Column(name = "name", nullable = false, length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "description", length = 65535)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "year", nullable = false, length = 0)
	public int getYear() {
		return this.year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	@Column(name = "price", nullable = false, precision = 12, scale = 0)
	public float getPrice() {
		return this.price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "modwinewines")
	public Set<Modwineitems> getModwineitemses() {
		return this.modwineitemses;
	}

	public void setModwineitemses(Set<Modwineitems> modwineitemses) {
		this.modwineitemses = modwineitemses;
	}

}
